// store = state = model
const initialState = { c: 0 };
// 描述action过来后，怎么处理

export const calculator = (state = initialState, action) => {
  switch (action.type) {
    case "PLUS": {
      return { c: state.c + action.number };
    }
    case "MINUS": {
      return { c: state.c - action.number };
    }
    default: {
      return state;
    }
  }
};
